<?php
/**
 * Created by ThinkPHP5.0.22.
 * User: 小涛.
 * Date: 2018/12/28.
 * Time: 23:43.
 */

namespace app\admin\model;


use think\Model;
use think\Request;

/**
 * Class Express 物流配送
 * @package app\admin\model
 */
class Express extends Model
{
    //列表
    public static function listExpress($listRow = 10){
        return self::order("status desc")
            -> paginate($listRow, false, [
                "query" => Request::instance() -> param()
            ]);
    }

    public static function Express(){
        return self::where(["status" => 1]) -> order("status desc")
            -> select();
    }

    public static function OrderExpress(){
        $express = self::order("status desc")
            -> page(1,10) -> select();
        $list = [];
        foreach ($express as $key => $val) {
            $list[$key] = [
                "express_id" => $val['id'],
                "express_title" => $val['com'],
            ];
        }
        return $list;
    }
}